<template>
  <div>
    <h3 @click="fn">全民砍价</h3>
    <div class="wai" v-for="item in data" :key="item.id">
      <div class="top_left">
        <img :src="item.pic" alt />
      </div>
      <div class="top_right">
        <p>{{item.name}}</p>
        <p class="item">{{item.characteristic}}</p>
        <div class="bottom">
          <span>￥{{item.minPrice}}</span>
          <span>{{item.originalPrice}}</span>
          <span>{{item.minPrice}}件</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      data: [],
    };
  },

  mounted() {
    //   console.log($API.kanjia)
    this.$API.kanjia().then((res) => {
      // console.log(res);
      this.data = res.data.data.goodsMap;
    });
    // this.fn();
  },
  methods: {
    fn() {
        // console.log(11);
      this.$router.push({
        path: "/darg",
        // query:{
        //   id:1,
        //   img:this.data.data.goodsMap.minPrice
        // }
      });
    },
  },
};
</script>
<style lang="scss">
h3 {
  text-align: center;
}
.wai {
  width: 100%;
  height: 6rem;
  display: flex;
  //   background: #000;
  .top_left {
    width: 30%;
    height: 100%;
    img {
      width: 100%;
      height: 5rem;
    }
  }
  .top_right {
    width: 70%;
    height: 100%;
    .bottom {
      display: flex;
      justify-content: space-around;
    }
  }
}
.item {
  font-size: 12px;
}
</style>